﻿@{
    ViewBag.Title = "EventTrigger";
    Layout = "~/Views/Shared/_Page.cshtml";
}

<h2>Event Trigger</h2>

<input type="button" id="btnTrigger" value="trigger" />

<script type="text/javascript">
    $(document).ready(function () {
        // define a javascript object
        var person = { name: 'Kelvin', age: 35 };

        // make it a jQuery object
        var $person = $(person);

        // bind an event
        $person.on('custom', function () {
            ZEUS.DEBUG.log("Name: " + person.name + ", Age: " + person.age);
        });

        $('#btnTrigger').click(function () {
            $person.trigger('custom');
        });
    });
</script>
